home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PASCALL / LIFE / LIFE.TXT < prev   
Text File  |  1993-09-04  |  789b  |  28 lines

  1. Life.pas
  2.  
  3. Life was originally a program that demonstrated the mathematical lifeforms.
  4.  
  5. this is a reproduction(from scratch math)....
  6.  
  7. the math is.. from a grid.  at any point on that grid:
  8.  
  9. from the sum of the surrounding eight points:
  10.  
  11.     ooo  x is the point
  12.     oxo  o's are the surrounding points
  13.     ooo
  14.  
  15. case sum of
  16.    0,1,4,5,6,7,8: x dies
  17.    2: x lives
  18.    3: x lives/born
  19. end;
  20.  
  21. that means if the sum is 0,1, or 4 through 8, the point on x is no more
  22. else if it is 2 or 3 the point stays how it is. if the sum is three and
  23. at the point there is no life at the momment, then one is born.
  24.  
  25.  
  26. My implementation is a bit slow mainly because of the HIGH grid size..
  27. I think I had a constant that you can change easily to change the size..
  28. thats all, and enjoy..